package com.ruoyi.common.id;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * 唯一ID获取类。<br>
 * 用于产生唯一ID
 */
public class UniqueIdUtil {

	@Autowired
	private static IdGenerator idGenerator;

	public void setIdGenerator(IdGenerator idGenerator_) {
		idGenerator = idGenerator_;
	}

	/**
	 * 获取字符型的ID
	 * 
	 * @return
	 */
	public static String getId() {
		return idGenerator.getId();
	}

	/**
	 * 获取长整型的ID
	 * 
	 * @return
	 */
	public static Long getUId() {
		return idGenerator.getUId();
	}
}
